package com.zzb.projectfactory.framework.role.entity;

import com.zzb.projectfactory.framework.autodoc.annotation.AutoDocField;
import com.zzb.projectfactory.framework.common.BaseEntity;
import com.zzb.projectfactory.framework.validator.annotation.ValidateNotNull;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


/**
* 角色表 实体类
*/
@Table(name = "sys_role")
@Entity
public class SysRole extends BaseEntity {
    @ValidateNotNull(msg = "角色名不能为空")
    @Column(name = "role_name")
    @AutoDocField(value = "角色名")
    private String roleName; //角色名
    @ValidateNotNull(msg = "角色代码不能为空")
    @Column(name = "role_code")
    @AutoDocField(value = "角色代码")
    private String roleCode; //角色代码

    /*----------------------get set 方法----------------------*/
    public String getRoleName() {return roleName;}
    public void setRoleName(String roleName){this.roleName = roleName == null ? null : roleName.trim();}
    public String getRoleCode() {return roleCode;}
    public void setRoleCode(String roleCode){this.roleCode = roleCode == null ? null : roleCode.trim();}
    /*----------------------toString 方法----------------------*/
    @Override
    public String toString() {
        return "SysRole{" +
        "id='" + getId() + '\'' + ',' + 
        "roleName='" + getRoleName() + '\'' + ',' + 
        "roleCode='" + getRoleCode() + '\'' + ',' + 
        "createTime='" + getCreateTime() + '\'' + ',' + 
        "creator='" + getCreator() + '\'' + ',' + 
        "updateTime='" + getUpdateTime() + '\'' + ',' + 
        "updater='" + getUpdater() + '\'' + ',' + 
        "activate='" + getActivate() + '\'' + 
        '}';
    }
}
